/* 
 * Enterprise Library Extensions - DI + ORM.
 * Copyright (C) 2006
 *
 * GNU General Public License
 *
 * This program is free software; you can redistribute 
 * it and/or modify it under the terms of the GNU General Public License 
 * as published by the Free Software Foundation; either version 2 of the 
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 * See the GNU General Public License for more details.
 */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace ELE.EnterpriseLibrary.Test
{
  public class Employee
  {
    private int id;
    private string name;
    private Address address;
    private List<Alias> aliases;
    private List<Equipment> equipment;

    private int age;
    private DateTime birthDate;

    public int Id
    {
      get { return id; }
      set { id = value; }
    }

    public string Name
    {
      get { return name; }
      set { name = value; }
    }
    public Address Address
    {
      get { return address; }
      set { address = value; }
    }
    public List<Alias> Aliases
    {
      get { return aliases; }
      set { aliases = value; }
    }
    public List<Equipment> Equipment
    {
      get { return equipment; }
      set { equipment = value; }
    }
    public int Age
    {
      get { return age; }
      set { age = value; }
    }
    public DateTime BirthDate
    {
      get { return birthDate; }
      set { birthDate = value; }
    }

    public override string ToString()
    {
      StringBuilder emp = new StringBuilder();
      emp.Append("-ID(").Append(this.Id).Append(")").Append(Environment.NewLine);
      emp.Append("-Name(").Append(this.Name).Append(")").Append(Environment.NewLine);
      emp.Append("-Address: ").Append(Environment.NewLine).Append(Environment.NewLine);
      emp.Append(this.Address.ToString()).Append(Environment.NewLine).Append(Environment.NewLine);
      int counter = 0;
      foreach (Alias alias in this.Aliases)
      {
        emp.Append("-Alias").Append(counter).Append(": ").Append(Environment.NewLine).Append(Environment.NewLine);
        emp.Append(alias.ToString()).Append(Environment.NewLine).Append(Environment.NewLine);
        counter++;
      }
      counter = 0;
      foreach (Equipment equi in this.Equipment)
      {
        emp.Append("-Equipment").Append(counter).Append(": ").Append(Environment.NewLine).Append(Environment.NewLine);
        emp.Append(equi.ToString()).Append(Environment.NewLine).Append(Environment.NewLine);
        counter++;
      }
      return emp.ToString();
    }
  }
}
